package com.stx.day1011;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

public class SeriakizeDemo {
    public static void main(String[] args) {
        User user = new User("张三", 18,"18325231132");
        try {
            FileOutputStream fos = new FileOutputStream("E:\\IDEA\\user.txt");
            ObjectOutputStream oos = new ObjectOutputStream(fos);
            oos.writeObject(user);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
